package com.slz3.business.module.socialManagement.socDianzan.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.socialManagement.socDianzan.domain.SocDianzan;
import com.slz3.business.module.socialManagement.socDianzan.domain.SocDianzanCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SocDianzanResController {

    static Mono<ServerResponse> add(ServerRequest req, SocDianzan socDianzan) {
        if (SocDianzanResUnsafeValid.add(req, socDianzan)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.add_$SocDianzanUpdateLock(req, socDianzan);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        if (SocDianzanResUnsafeValid.delete(req, socDianzanCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.delete_$SocDianzanUpdateLock(req, socDianzanCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, SocDianzan socDianzan) {
        if (SocDianzanResUnsafeValid.modify(req, socDianzan)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.modify_$SocDianzanUpdateLock(req, socDianzan);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (SocDianzanResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (SocDianzanResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.info_$SocDianzanUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (SocDianzanResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        //
        if (SocDianzanResUnsafeValid.auditSubmit(req, socDianzanCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.auditSubmit_$SocDianzanUpdateLock(req, socDianzanCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        if (SocDianzanResUnsafeValid.audit(req, socDianzanCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.audit_$SocDianzanUpdateLock(req, socDianzanCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        if (SocDianzanResUnsafeValid.auditReject(req, socDianzanCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.auditReject_$SocDianzanUpdateLock(req, socDianzanCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        if (SocDianzanResUnsafeValid.usingEnable(req, socDianzanCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.usingEnable_$SocDianzanUpdateLock(req, socDianzanCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, SocDianzanCondition socDianzanCondition) {
        if (SocDianzanResUnsafeValid.usingDisable(req, socDianzanCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocDianzanResAtomic.usingDisable_$SocDianzanUpdateLock(req, socDianzanCondition);
        }
    }

}
